<?php

class Comments extends BaseModel
{

    private $table = 'comments';

    public function __construct()
    {

    }

    public function addComments($data)
    {

        $res = db()->insert($this->table, $data);
        return $res;
    }
    public function getAllComments(){
        $sql = "select comments.* ,user.username from comments left join user on comments.uid = user.id order by id desc";
        $res = db()->doSql($sql);
        return $res;
    }
}